import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '项目',
    align:"center",
    dataIndex: 'project'
   },
  {
    title: '申请项目类型',
    align:"center",
    dataIndex: 'otherProjectType_dictText'
  },
   {
    title: '申请费用总额',
    align:"center",
    dataIndex: 'totalAmount'
   },
  {
    title: '申请人',
    align:"center",
    dataIndex: 'realName'
  },
   {
    title: '费用申请状态',
    align:"center",
    dataIndex: 'status_dictText'
   },
   {
    title: '说明',
    align:"center",
    dataIndex: 'remark'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [

  {
    label: '费用申请状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'submitStatus',
      stringToNumber: true,
    },
    colProps: { span: 6 },
  },
  {
    label: '费用申请类型',
    field: 'otherProjectType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'otherProjectType',
      stringToNumber: true,
    },
    colProps: { span: 6 },
  }
];
//表单数据
export const formSchema: FormSchema[] = [
    {
    label: '申请项目类型',
    field: 'otherProjectType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'otherProjectType',
      stringToNumber: true,
    },
  },

  {
    label: '项目',
    field: 'projectId',
    slot: 'projectId',
    component: 'JDictSelectTag',
    // component: 'Input',
  },
  {
    label: '费用总额',
    field: 'totalAmount',
    component: 'InputNumber',
  },
/*  {
    label: '费用申请状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'submitStatus',
      stringToNumber: true,
    },
  },*/
  {
    label: '说明',
    field: 'remark',
    component: 'InputTextArea',
  },
  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    componentProps:{
      returnUrl: false
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const otherFormSchema: FormSchema[] = [
  {
  label: '申请项目类型',
  field: 'otherProjectType',
  component: 'JDictSelectTag',
  componentProps: {
    dictCode: 'otherProjectType',
    stringToNumber: true,
  },
},

{
  label: '项目',
  field: 'project',
  slot: 'project',
  component: 'JDictSelectTag',
  // component: 'Input',
},
{
  label: '费用总额',
  field: 'totalAmount',
  component: 'InputNumber',
},
/*  {
  label: '费用申请状态',
  field: 'status',
  component: 'JDictSelectTag',
  componentProps: {
    dictCode: 'submitStatus',
    stringToNumber: true,
  },
},*/
{
  label: '说明',
  field: 'remark',
  component: 'Input',
},
{
  field: 'uploadFile',
  component: 'JUpload',
  helpMessage: '附件上传',
  label: '附件上传',
  componentProps:{
    returnUrl: false
  }
},
// TODO 主键隐藏字段，目前写死为ID
{
  label: '',
  field: 'id',
  component: 'Input',
  show: false
},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
